
<form method="post" name="frmSearch" action="<?php echo site_url('masterbarangcontroller');?>">
    <table width="100%" cellpadding="3" cellspacing="0" border="1">
        <tr>
            <td width="105"><strong>Pilih Search</strong></td>
            <td width="27" align="center"><strong>:</strong></td>
            <td width="839" colspan="3">
                <select name="kdbrgview">
                    <option value="0">Pilih</option>
                    <option value="1">Kode Barang</option>
                    <option value="2">Nama Barang</option>
                </select> &nbsp;|&nbsp;<input type="text"  name="brgview" id="brgview" size="50" />&nbsp;|&nbsp;<input type="submit" name="btnview" value="Search">
            </td>
		</tr>
    </table>
</form>
<br />
<form method="post" name="frmSave" action="<?php echo site_url('masterbarangcontroller/tambahmasterbarang');?>">
    <table width="100%" cellpadding="3" cellspacing="0" border="1">
    	<tr style="background-color:#FFF; color:#000000;" align="center">
        	<td colspan="3" height="25"><strong>INPUT DAFTAR BARANG</strong></td>
    	</tr>
        <tr >
        	<td colspan="3" height="25">&nbsp;</td>
    	</tr>
        <tr>
            <td width="109"><strong>Kode Barang</strong></td>
            <td width="29" align="center"><strong>:</strong></td>
            <td width="833" colspan="3"><input type="text"  name="kdbrng" id="kdbrng" maxlength="12" size="25"/></td>
        </tr>
        <tr>
            <td width="109"><strong>Nama Barang</strong></td>
            <td width="29" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="nmbrng" id="nmbrng" maxlength="100" size="50" /></td>
        </tr>
        <tr>
            <td width="109"><strong>Keterangan</strong></td>
            <td width="29" align="center"><strong>:</strong></td>
            <td ><input type="text"  name="description" id="description" size="50" maxlength="100"/></td>
        </tr>
        <tr>
            <td width="109"><strong>Tipe Unit</strong></td>
            <td width="29" align="center"><strong>:</strong></td>
            <td>
            	<select name="tpunit">
                	<option value="">--Pilih--</option>
                    <option value="BTG">Batang</option>
                    <option value="DUS">Dus</option>
                    <option value="LBR">Lembar</option>
                    <option value="PCS">Pcs</option>
                    <option value="ROLL">Roll</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center"><input type="submit" value="Save" name="btnSave" >&nbsp;<input type="button" name="btnClose" value="Back" class="btn" onclick="javascript:window.location='<?php echo site_url('menuhomecontroller'); ?>';" /></td>
        </tr>
    </table>
</form>
<br />
<br />
<div class="cleaner_h10"></div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
    <tr style="background-color:#FFF; color:#000000;" align="center">
        <td colspan="5" height="25"><strong>LIST MASTER BARANG</strong></td>
    </tr>
    <tr style="background-color:#333; color:#FFF;" align="center">
        <td>Kode Barang</td>
        <td>Nama Barang</td>
        <td>Description</td>
        <td>Tipe Unit</td>
        <td>&nbsp;</td>
    </tr>
	<?php if(count($mstrbarang)>0){ ?>
        {mstrbarang}
            <tr class="cellDefault">
                <td align="center">{KodeBarang}</td>
                <td align="center">{Productname}</td>
                <td align="left">{Description}</td>
                <td align="center">{Typeunit}</td>
                <td align="center">
                	<button onclick="javascript:window.location='<?php echo site_url('masterbarangdetailcontroller/viewdetail');?>/{KodeBarang}';" id="viewdet">Detail</button>
                    &nbsp;|&nbsp;
                    <button onclick="javascript:window.location='<?php echo site_url('masterbarangcontroller/ubahmasterbarang');?>/{KodeBarang}';" id="edit">Edit</button>
                    <?Php 
						if($this->session->userdata('grade') == 0)
						{
					?>
							&nbsp;|&nbsp;
                            <button onclick="javascript:window.location='<?php echo site_url('masterbarangcontroller/deletemasterbarang');?>/{KodeBarang}';" id="hapus">Hapus</button>
					<?php } ?>
				</td>
            </tr>
        {/mstrbarang}
    <?php } else{
            echo "<tr>";
            echo "<td colspan='9' style='text-align:center;color:red;'>No Data To Display</td>";
            echo "</tr>";
    } ?>
    <?php if(!empty($message))?>{message}
</table>
<?php echo $links; ?>